package co.edu.javeriana.aes.patrones.monopolio.message;

import co.edu.javeriana.aes.patrones.monopolio.session.Session;
import java.io.Serializable;

public class Message implements Serializable {

    private Session session;
    private MessageType command;
    private Serializable data;

    public Message(Session session, Serializable data, MessageType command) {
        this.session = session;
        this.data = data;
        this.command = command;
    }

    public Serializable getData() {
        return data;
    }

    public void setData(Serializable data) {
        this.data = data;
    }

    public Session getSession() {
        return session;
    }

    public void setSession(Session session) {
        this.session = session;
    }

    public MessageType getCommand() {
        return command;
    }

    public void setCommand(MessageType command) {
        this.command = command;
    }

    @Override
    public String toString() {
        return "Message{" + "session=" + session + ", command=" + command + ", data=" + data + '}';
    }
}
